1. Field of the Invention
The present invention pertains to a decoder of dynamic image compressed data, and mainly to a controlling apparatus for repetitively reading GOP (group of pictures) data stored in a stream buffer in order to regenerate dynamic image compressed data in reverse sequence and to a method therefor.
2. Description of the Related Art
MPEG 1 and MPEG 2 (Moving Picture Image Coding Experts Group Phase 1) are well known as international standards for dynamic image compression. Dynamic image compressed data is regenerated and displayed by a decoder constructed in accordance with the MPEG 1 and MPEG 2 standards. FIG. 4 is a schematic block diagram of a system for decoding and displaying dynamic image compressed data read from a storage medium. System compressed data read from a storage medium 1 such as a DVD (digital video decoder), VOD (Video On Demand), CD-ROM, etc. is provided to a pre-parser 2, where the data is divided into each component information (image, sound, information file, etc.). The dynamic image compressed data which passed the pre-parser 2 is sent to a DRAM (dynamic RAM) controller 3 and is temporarily stored in a stream buffer 5 installed in a DRAM 4. The dynamic image compressed data stored in the stream buffer 5 is read at a predetermined rate under control of the DRAM controller 3 and is sent to a decoder 6. The decoder 6, which includes a variable-length decoder, reverse quantizer, reverse DCT (reverse discrete cosine transformation), movement compensation anticipation function, etc., performs a decoding operation on dynamic image compressed data in accordance with the known MPEG 2 standard. Picture data regenerated by the decoder 6 is stored as a reference picture for creating the next picture and is also sent to a display controller 8 to be displayed.
Next, a conventional read/write operation of the stream buffer 5 will be explained by way of FIGS. 5 and 6 for the sake of better understanding the present invention. FIG. 5 is a diagram indicating a concept of a read/write (R/W) operation of the stream buffer 5. The DRAM controller 3 conducts processing in accordance with the flow described in FIG. 6 to perform the operation indicated in FIG. 5. Dynamic image compressed data to be stored in the storage medium 1 such as a DVD, etc. consists of a collection of GOPs (groups of pictures), each of which is treated as a unit of data of several pictures using an I picture (intra coding image), P picture (forward anticipation coding image) and B picture (bidirectional anticipation coding image). Data can be accessed sequentially in GOP units. The stream buffer 5 has a storage capacity to store more than one GOP. It is assumed now that more than one GOP respectively containing N pictures (hereafter referred to as GOPN) which was read from the storage medium 1 is stored in the stream buffer 5. At step S1 in FIG. 6, it is determined whether a write operation or read operation is occurring. If it is a write operation, the processing proceeds to step S2. At step S2, image data equivalent to one word is written in an address in the stream buffer 5 pointed to by a write pointer WP. At the next step S3, it is determined whether or not the write pointer WP is pointing to the end address E-adr of the stream buffer 5. If it is determined that it is not, the processing proceeds to step S4, where 1 is added to the current address of the write pointer WP. Then, operations of steps S1.about.S4 are performed in the same manner as explained above, whereby the write pointer WP writes image data of GOP in the stream buffer 5 while being incremented by 1 at a time. If it is determined at step S3 that the write pointer WP has reached the end address E-adr, the processing proceeds to step S5 and the write pointer WP of the stream buffer 5 is set to point to the start address S-adr. As is indicated in FIG. 5, a write operation by the write pointer WP is performed cyclically.
On the other hand, if it is determined at the step S1 that a read operation is occurring, the processing proceeds to step S6, where image data equivalent to one word is read from an address in the stream buffer 5 pointed to by a read pointer RP. At the next step S7, it is determined whether or not the read pointer RP is pointing to the end address E-adr of the stream buffer 5. If it is determined that it is not, the processing proceeds to step S8, where 1 is added to the current address of the read pointer RP. Then, operations of the step S1 and steps S6.about.S8 are performed in the same manner as explained above, whereby the read pointer RP reads image data of GOP from the stream buffer 5 while being incremented by 1 at a time. If it is determined at step S7 that the read pointer RP has reached the end address E-adr, the processing proceeds to step S9 and the read pointer RP of the stream buffer 5 is set to point to the start address S-adr. As is indicated in FIG. 5, a read operation by the read pointer RP is performed on all addresses in the stream buffer 5 cyclically. If the write pointer WP has finished a round of procedure and overtaken the read pointer RP, it is not allowed to perform a write operation and instead waits by until a free space arises in the stream buffer 5.
The MPEG 1 and MPEG 2 standards provide for a trick mode. Thus, theoretically, it is possible to regenerate a dynamic image in reverse sequence as in a video deck. In order to regenerate an image in reverse sequence, a P picture or B picture constituting the last picture in GOP needs to be displayed first. In order to display the last picture, a P picture before the last P picture needs to be decoded and so on, up to the first picture of the GOP. Ultimately, all the I and P pictures ( or B pictures if necessary) in the GOP need to be decoded. Therefore, if all the decoded pictures in the GOP can be stored, the GOP can be regenerated in reverse sequence. By decoding and storing a GOP preceding the regenerated GOP in the same manner while displaying the regenerated GOP and repeating the processing, theoretically, it is supposed to be possible to regenerate a dynamic image in reverse sequence. However, one GOP consists of about 15 pictures in general and thus, it is not practical in terms of cost to store all the pictures in a storage element, because memory having a large capacity is required.
The aforementioned frame memory 7 normally has a region enough for only about three pictures. Considering a memory capacity, there is another way of regenerating a dynamic image in reverse sequence. According to the other way, dynamic image compressed data is first read in units of GOP data and is written in the stream buffer 5 temporarily. Then, the GOP data is sequentially read from the stream buffer 5 to be decoded and upon storing the last three of the thus decoded pictures in the frame memory 7, the picture data is displayed in reverse sequence. After the display of the picture data in reverse sequence has been started, the same processing as mentioned above, that is processing of reading the same GOP from the storage medium 1, decoding, storing and displaying the same is repeated and subsequently, picture data of the 4th.about.6th pictures from the last in the GOP is displayed in reverse sequence. Thus, when a GOP contains 15 pictures, it is assumed that all the pictures in the GOP from the first to the last can be regenerated in reverse sequence by repeating the aforementioned processing five times. However, as reading GOP data from the storage medium 1 such as a DVD, etc. is conducted by using a mechanical device, a control operation becomes complicated and, as a consequence, becomes more prone to failure, malfunction, etc. Further, a control operation via mechanical means is slower than an electronic control operation.